package com.ruoyi.uni.mapper;

import java.util.List;

import com.ruoyi.uni.domain.DcGoods;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * 餐品管理Mapper接口
 * 
 * @author hx
 * @date 2024-04-17
 */
public interface DcGoodsMapper 
{

    @Update("update  dc_goods set location=#{location} where id=#{id}")
    public Long updateLocationById(@Param("id") String id, @Param("location") Long location);

    @Select("select * from dc_goods where location<#{location} and type=#{type} order by location desc limit 1")
    public DcGoods selectMoveUp(@Param("location") Long location, @Param("type") Long type);

    @Select("select * from dc_goods where location>#{location} and type=#{type} order by location  limit 1")
    public DcGoods selectMoveDown(@Param("location") Long location,@Param("type") Long type);
    @Select("SELECT COUNT(*) FROM dc_goods where type=#{type}")
    public Long selectDcGoodsCount(@Param("type") Long type);

//    @Select("select * from dc_goods where type=#{type}")
    public List<DcGoods> selectDcGoodsByType(@Param("type") Long type);
    /**
     * 查询餐品管理
     * 
     * @param id 餐品管理主键
     * @return 餐品管理
     */
    public DcGoods selectDcGoodsById(String id);

    /**
     * 查询餐品管理列表
     * 
     * @param dcGoods 餐品管理
     * @return 餐品管理集合
     */
    public List<DcGoods> selectDcGoodsList(DcGoods dcGoods);

    /**
     * 新增餐品管理
     * 
     * @param dcGoods 餐品管理
     * @return 结果
     */
    public int insertDcGoods(DcGoods dcGoods);

    /**
     * 修改餐品管理
     * 
     * @param dcGoods 餐品管理
     * @return 结果
     */
    public int updateDcGoods(DcGoods dcGoods);

    /**
     * 删除餐品管理
     * 
     * @param id 餐品管理主键
     * @return 结果
     */
    public int deleteDcGoodsById(String id);

    /**
     * 批量删除餐品管理
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteDcGoodsByIds(String[] ids);
}
